<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/vue/2.5.17/vue.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.4.11/index.js"></script>
  <script src="https://cdn.staticfile.org/echarts/4.2.1-rc1/echarts.min.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.4.11/theme-chalk/index.css" />
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
  <script src="../theme/avue.project.js"></script>
  <script src="../theme/halloween.project.js"></script>
  <script src="../theme/wonderland.project.js"></script>
</head>

<body>
  <div id="app">
    <el-button @click='change1'>换紫色主题</el-button>
    <el-button @click='change2'>换绿色主题</el-button>
    <avue-echart-funnel :theme='theme' :option="option" :data="data"></avue-echart-funnel>
  </div>
</body>
<script>
  window.echarts.registerTheme(theme.themeName, theme.theme)
  window.echarts.registerTheme(theme1.themeName, theme1.theme)
  window.echarts.registerTheme(theme2.themeName, theme2.theme)
  new Vue({
    el: '#app',
    data() {
      return {
        theme: "",
        data: [{
            value: 335,
            name: '直接访问'
          },
          {
            value: 310,
            name: '邮件营销'
          },
          {
            value: 234,
            name: '联盟广告'
          },
          {
            value: 135,
            name: '视频广告'
          },
          {
            value: 1548,
            name: '搜索引擎'
          }
        ],
        option: {
          width: '100%',
          height: 600,
          titleShow: true,
          title: '手机大比拼',
          subtext: '最近一个月',
          titleColor: '#666',
          titleFontSize: 18,
          tipFontSize: 18,
          fontSize: 18,
          legendFontSize: 18,
          // legend: true,
          labelShow: true,
          radius: true,
          "barColor": [{
              "color1": "#83bff6",
            },
            {
              "color1": "#23B7E5",
            },
            {
              "color1": "rgba(154, 168, 212, 1)",
            },
            {
              "color1": "#188df0",
            },
            {
              "color1": "#564AA3",
            }
          ]
        },

      }
    },
    methods: {
      change1() {

        this.theme = theme1.themeName
      },
      change2() {
        this.theme = theme2.themeName
      },
    },
  })

</script>

</html>
